package com.cashmama.market.api.infras.enums.product;

/**
 * 底部菜单枚举
 *
 * @author liuming
 * Created on 下午2:30 2019/4/16.
 */
public enum BottomMenuCashMallEnum {
    HOME("Home",
            "https://dc-oss2.oss-ap-south-1.aliyuncs.com/app/cashmall/tab_home_normal.png",
            "https://dc-oss2.oss-ap-south-1.aliyuncs.com/app/cashmall/tab_home_highlight.png",
            "URL/home",
            false),
    ORDER("Order",
            "https://dc-oss2.oss-ap-south-1.aliyuncs.com/app/cashmall/tab_order_normal.png",
            "https://dc-oss2.oss-ap-south-1.aliyuncs.com/app/cashmall/tab_order_highlight.png",
            "URL/orderlist",
            true),
    ACCOUNT("Account",
            "https://dc-oss2.oss-ap-south-1.aliyuncs.com/app/cashmall/tab_mine_normal.png",
            "https://dc-oss2.oss-ap-south-1.aliyuncs.com/app/cashmall/tab_mine_highlight.png",
            "URL/mine",
            true);

    BottomMenuCashMallEnum(String title, String imgUrl, String imgCheckedUrl, String jumpUrl, Boolean needLogin) {
        this.title = title;
        this.imgUrl = imgUrl;
        this.imgCheckedUrl = imgCheckedUrl;
        this.jumpUrl = jumpUrl;
        this.needLogin = needLogin;
    }

    private String title;

    private String imgUrl;

    private String imgCheckedUrl;

    private String jumpUrl;

    private Boolean needLogin;

    public String getTitle() {
        return title;
    }

    public BottomMenuCashMallEnum setTitle(String title) {
        this.title = title;
        return this;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public BottomMenuCashMallEnum setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
        return this;
    }

    public String getImgCheckedUrl() {
        return imgCheckedUrl;
    }

    public BottomMenuCashMallEnum setImgCheckedUrl(String imgCheckedUrl) {
        this.imgCheckedUrl = imgCheckedUrl;
        return this;
    }

    public String getJumpUrl() {
        return jumpUrl;
    }

    public BottomMenuCashMallEnum setJumpUrl(String jumpUrl) {
        this.jumpUrl = jumpUrl;
        return this;
    }

    public Boolean getNeedLogin() {
        return needLogin;
    }

    public BottomMenuCashMallEnum setNeedLogin(Boolean needLogin) {
        this.needLogin = needLogin;
        return this;
    }

    public static BottomMenuCashMallEnum getByJumpUrl(String jumpUrl) {
        for (BottomMenuCashMallEnum enums : BottomMenuCashMallEnum.values()) {
            if (enums.getJumpUrl().equals(jumpUrl)) {
                return enums;
            }
        }
        return null;
    }
}
